//
//  CustomWebViewController.h
//  Vgo
//
//  Created by 21CN Vgo on 10-10-18.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum CustomWebViewState {
	CWVS_Normal,
	CWVS_Loading,
	CWVS_Network
}CustomWebViewState;

@protocol CustomWebViewDelegate <NSObject>

- (BOOL)handleCustomURI:(NSURL *)url;
- (void)webViewDidStartLoad:(UIWebView *)theWebView;
- (void)webViewDidFinishLoad:(UIWebView *)theWebView;
- (void)webViewStateChanged:(CustomWebViewState)state;

@end

@interface CustomWebViewController : UIViewController <UIWebViewDelegate> {
	UIWebView * webView;
	UIView * loadingView;
	UIView * networkStateView;
	UIView * loadingSubView;
	BOOL showLoading;
	BOOL showContentWhenLoading;
	id<CustomWebViewDelegate> delegate;
	BOOL bounces;
	CustomWebViewState state;
	NSURL * currentUrl;
}

@property (nonatomic, retain) IBOutlet UIWebView * webView;
@property (nonatomic, retain) IBOutlet UIView * loadingView;
@property (nonatomic, retain) IBOutlet UIView * networkStateView;
@property (nonatomic, retain) IBOutlet UIView * loadingSubView;
@property (nonatomic, assign) BOOL showLoading;
@property (nonatomic, assign) BOOL showContentWhenLoading;
@property (nonatomic, assign) IBOutlet id<CustomWebViewDelegate> delegate;
@property (nonatomic) BOOL bounces;
@property (nonatomic, assign) CustomWebViewState state;
@property (nonatomic, retain) IBOutlet NSURL * currentUrl;

- (void)loadURLString:(NSString *)urlString withBookmark:(NSString *)bookmark;
- (void)loadURLString:(NSString *)urlString;
- (void)loadURL:(NSURL *)url;
- (void)reload;

@end
